<html>
<head>
<meta http-equiv=Content-Type content=text/html;charset=utf-8>
<#include "../inc/commonJs.html">
<script language="JavaScript">
	function saveObj(id){
		var url = 'addEmail.do';
		$('form').form('submit',{  
		    url:url,
		    onSubmit:function(param){
		    		 param.receiver = $('#receiver').combobox('getText');    
	        		 param.receiverids = $('#receiver').combobox('getValues');
		        return $(this).form('validate');  
		    }, 
		    success:function(data){  
				top.closemodalwindow(true,data);
		    }  
		});
	}
	//
	$(function(){
		var a = "${obj.content!}";
		var b = a.split("%OD%OA");
		var str = "";
		for(var i =0; i<b.length;i++){
			str += b[i]+"\r";
		}
		$('#receiver').combobox('setValue','${obj.userid!}');
		$('#title').val("回复：${obj.title!}");
		$('#oldcontent').val("------------------ 原始邮件 ------------------\r发件人：${obj.sender!}\r发件时间：${obj.dt!}\r主题:${obj.title!}\r"+str+"\r");
	})
</script>

</head>
<body>
<table border="0" width="98%" cellpadding="0" cellspacing="0" align="center" class="table_all">
<form align="center" method="post">
      <tr>
        <td height="32" align="right" class="td_table_1"><span class="smallFont">收件人：</span></td>
        <td height="32" class="td_table_2"><div align="left">&nbsp;
            <input id="receiver" class="easyui-combobox"  style="width:300px;" panelHeight:"auto" data-options="multiple:true,valueField:'userid',textField:'username',url:'../system/listUserForCombox.do'" />
          </div></td>
      </tr>
      <tr>
        <td height="32"  class="td_table_1"><span class="smallFont">标题：</span></td>
        <td height="32" class="td_table_2"><div align="left">&nbsp;
            <input name="title" id="title" value="" class="easyui-validatebox" maxlength="30" style="width:300px;" type="text" >
          </div></td>
      </tr>
      <#if obj.emailid?string !="">
      	<input type="hidden" id="oldemailid" name="oldemailid" value="${obj.emailid!0}">
      	<input type="hidden" id="zt" name="zt" value="1">
      	<tr>
	        <td height="32" class="td_table_1"><span class="smallFont">原内容：</span></td>
	        <td  valign="middle" class="td_table_2">&nbsp;
	          <textarea  name="oldcontent" id="oldcontent" value="" style="width:400px;height:120px"  ></textarea></td>
	    </tr>
      </#if>
      <tr>
        <td height="32"  class="td_table_1"><span class="smallFont">回复内容：</span></td>
        <td  valign="middle" class="td_table_2">&nbsp;
          <textarea  name="content" id="content" value="" style="width:400px;height:120px"  ></textarea>
         </td>
      </tr>
</form>
  </table>
</body>
</html>